/**
 * @file
 * @brief This file contains common types definitions for the demolib API.
 */

#ifndef NOSAL_DEMOLIB_COMMON_H
#define NOSAL_DEMOLIB_COMMON_H

#include <cstdint>
#include <type_traits>

namespace netaos {
namespace nosal {
namespace demo {
namespace lib {

/**
 * @defgroup common Common Types
 * @brief Common type definitions for the demolib API.
 */

/**
 * @brief Return. Flags to define return values.
 */
enum class ReturnValue : std::int8_t {
    kWrongParameter = -2,
    kError = -1,
    kOk = 0,
    kTrue = 1
};

template <typename EnumT>
constexpr auto ReturnValueToIntegral(const EnumT value) noexcept {
    return static_cast<std::underlying_type_t<EnumT>>(value);
}

/// @}
}  // namespace lib
}  // namespace demo
}  // namespace nosal
}  // namespace netaos

#endif  // NOSAL_DEMOLIB_COMMON_H
